# -*- coding:UTF-8 -*-

import os
import sys

global applicationPath
global configPath
global logDir

'''
目录管理类
# @author bricker
'''
class Directory(object):

    def __init__(self):
        global applicationPath
        global configPath
        global logDir
        if getattr(sys, 'frozen', False):
            applicationPath = os.path.dirname(sys.executable)
        elif __file__:
            applicationPath = os.path.dirname(os.path.dirname(__file__))

        configPath = os.path.join(applicationPath, 'conf', 'config.conf')
        logDir = os.path.join(applicationPath, 'logs')
        if not os.path.exists(logDir):
            os.makedirs(logDir)


    @staticmethod
    def getApplication():
        global applicationPath
        return applicationPath
    @staticmethod
    def getConfig():
        global configPath
        return configPath
    @staticmethod
    def getLogDir():
        global logDir
        return logDir

d = Directory()